<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<% String context = request.getContextPath(); %>
<html>
<head>
    <title>普通任务</title>
    <link rel="stylesheet" href="<%=context %>/Source/lib/layui/css/layui.css">
    <style type="text/css">
        .information{
            display: none;
        }
    </style>
</head>
<body style="margin: 0;">

<!-- 2018/5/25新增： 对外提供服务时，能够将 流程审核人的id传进来 -->
<input id="approverId" type="hidden" value="${approverId}" />
<input id="executorName" type="hidden" value="${executorName}" />

<table class="layui-table">
    <colgroup>
        <col>
        <col>
        <col>
        <col>
    </colgroup>
    <thead>
    <tr>
        <th colspan="4">业务摘要信息</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>流程发起人：</td>
        <td id="startUser" ></td>
        <td>工作说明：</td>
        <td id="flowRemark" ></td>
    </tr>
    </tbody>
    <%--<template >--%>
    <thead class="information">
    <tr>
        <th colspan="4">上一步处理信息</th>
    </tr>
    </thead>
    <tbody class="information" >
    <tr >
        <td>任务名称：</td>
        <td id="taskName"></td>
        <td>完成时间：</td>
        <td id="lastCompleteTime"></td>
    </tr>
    <tr>
        <td>完成人：</td>
        <td id="completeUser"></td>
        <td>完成意见：</td>
        <td id="completeRemark"></td>
    </tr>
    </tbody>
    <%--</template>--%>
    <tbody>
    <tr>
        <td>处理意见：</td>
        <td colspan="3">
            <textarea style="width: 98%;height: 100px" id="dealSuggestion"></textarea>
        </td>
    </tr>
    </tbody>
</table>

<input type="hidden" id="taskId" value="">
<input type="hidden" id="taskNodeCode" value="">
<input type="hidden" id="otherTaskIds" value="">
</body>
<script src="<%=context %>/gooflow/jquery.min.js"></script>
<%--<script src="<%=context %>/Source/lib/ligerUI/js/ligerui.all.js"></script>--%>
<script src="<%=context %>/Source/lib/layui/layui.js"></script>
<script src="<%=context %>/microcore/commonjs/utility.js"></script>
<script type="text/javascript">
    var path = '<%=context %>';
    var _path = path + "/flow/task";
    var taskModel = ${taskModel};
    var beforTaskModel = ${beforTaskModel};
    var approverId = $('#approverId').val();



    $(function(){

        $("#startUser").text(taskModel.startUser);
        $("#flowRemark").text(taskModel.flowRemark);
        $("#taskId").val(taskModel.taskId);
        //$("#taskNodeCode").val();
        //$("#otherTaskIds").val();
        if("流程启动"==beforTaskModel.taskName){
            $("#no_information").show();
        }else{
            $("#taskName").text(beforTaskModel.taskName);
            $("#lastCompleteTime").text(beforTaskModel.lastCompleteTime);
            $("#completeRemark").text(beforTaskModel.completeRemark);
            $("#completeUser").text(beforTaskModel.completeUser);
            $(".information").show();
        }


    });



    function complete(loc){
        var completeTaskRequest = {
            taskId:$("#taskId").val(),
            taskNodeCode:$("#taskNodeCode").val(),
            otherTaskIds:$("#otherTaskIds").val(),
            dealSuggestion:$("#dealSuggestion").val().trim(),
            taskType:taskModel.taskType
        };
        $.ajax({
            url: _path + "/completeTask"+"?approverId="+approverId + "&executorName=" + $('#executorName').val(),
            type: "POST",
            //contentType: 'application/json;charset=utf-8', //设置请求头信息
            dataType: "json",
            data: completeTaskRequest,
            success: function (result) {
                loc.reload(true);
            }
        });
    }
</script>
</html>
